1. Field of the Invention
The present invention relates generally to computer security, and more particularly but not exclusively to methods and apparatus for protecting web documents against web-injection attacks.
2. Description of the Background Art
Web documents, such as webpages, are susceptible to web-injection attacks. A web-injection attack is a man-in-the-middle attack where malware (e.g., computer virus) modifies a legitimate webpage to add malicious functionality. For example, the malware may inject malicious code into a webpage served by a web server of an online bank. When the webpage is rendered by a web browser, the malicious code executes to ask the user for additional information that is received by the malware rather than the online bank. This is schematically illustrated in FIG. 1, which shows a webpage 115 rendered by a web browser 202. In the example of FIG. 1, the message 116 is displayed by the malicious code injected by the malware into the webpage 115. Because the message 116 occurs in the middle of a transaction with the online bank, users may be fooled into believing that the online bank is asking for the additional information indicated in the message 116.